#include "BFString.h"

int main()
{
    SString S, T;
    InputString(&S);
    InputString(&T);
    int i = BFMatch(S, T, 1); 
    printf("%d", i);
    return 0;
}